package cn.geoportal.benoserver.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 空间库表
 * @TableName t_spatialdb
 */
@TableName(value ="t_spatialdb")
@Data
public class Spatialdb implements Serializable {
    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JSONField(ordinal = 0)
    @ApiModelProperty(value = "id", required = false, hidden = true)
    private Integer id;

    /**
     * 数据库名
     */
    @TableField(value = "name")
    @JSONField(ordinal = 1)
    @ApiModelProperty(value = "空间服务器名称", position = 1, required = true, example = "spatialdb")
    private String name;

    /**
     * 服务器IP
     */
    @TableField(value = "ip")
    @JSONField(ordinal = 2)
    @ApiModelProperty(value = "服务器IP", position = 2, required = true, example = "127.0.0.1")
    private String ip;

    /**
     * 服务端口
     */
    @TableField(value = "port")
    @JSONField(ordinal = 3)
    @ApiModelProperty(value = "服务端口", position = 3, required = true, example = "5432")
    private String port;

    /**
     * 数据库用户名
     */
    @TableField(value = "dbuser")
    @JSONField(ordinal = 4)
    @ApiModelProperty(value = "数据库用户名", position = 4, required = true, example = "postgres")
    private String dbuser;

    /**
     * 数据库用户密码
     */
    @TableField(value = "password")
    @JSONField(ordinal = 5)
    @ApiModelProperty(value = "数据库密码", position = 5, required = true, example = "postgres")
    private String password;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JSONField(ordinal = 6)
    @ApiModelProperty(value = "创建时间", required = false, hidden = true)
    private Date createdat;

    /**
     * 更新时间
     */
    @TableField(value = "updatedat", fill = FieldFill.INSERT_UPDATE)
    @JSONField(ordinal = 7)
    @ApiModelProperty(value = "更新时间", required = false, hidden = true)
    private Date updatedat;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}